{% extends 'base.html' %}
{% load static %}

{% block title %}网上商城-首页{% endblock title %}

{% block toplink %}
	<script type="text/javascript" src="{% static 'js/jquery-1.12.4.min.js' %}"></script>
	<script type="text/javascript" src="{% static 'js/jquery-ui.min.js' %}"></script>
	<script type="text/javascript" src="{% static 'js/slide.js' %}"></script>
{% endblock toplink %}

{% block content %}
	{% include 'header-con.html' %}

	{% include 'search-bar.html' %}

	<div class="navbar_con">
		<div class="navbar">
			<h1 class="fl">全部商品分类</h1>
			<ul class="navlist fl">
				<li><a href="/">首页</a></li>
				<li class="interval">|</li>
				<li><a href="/goods/select/">抽奖</a></li>
			</ul>
		</div>
	</div>

	<div class="center_con clearfix">
		<ul class="subnav fl">
			{% for type in types %}
			<li><a href="#model0{{ forloop.counter }}" >{{ type.name }}</a></li>
			{% endfor %}
		</ul>
		<div class="slide fl">
			<ul class="slide_pics">
				{% for banner in banners %}
				<li><img src="{{ banner.image.url }}" alt="幻灯片"></li>
				{% endfor %}
			</ul>
			<div class="prev"></div>
			<div class="next"></div>
			<ul class="points"></ul>
		</div>
		<div class="adv fl">
			{% for promotion in promotions %}
			<a href="#"><img src="{{ promotion.image.url }}"></a>
			{% endfor %}
		</div>
	</div>
{% for type in types %}
	<div class="list_model">
		<div class="list_title clearfix">
			<h3 class="fl" id="model0{{ forloop.counter }}">{{ type.name }}</h3>
			<div class="subtitle fl">
				<span>|</span>
				{% for title in type.title_banners %}
				<a href="#">{{ title.good.name }}</a>
				{% endfor %}
			</div>
			<a href="/goods/list/{{ type.id }}/1/" class="goods_more fr" id="{{ type.logo }}_more">查看更多</a>
		</div>

		<div class="goods_con clearfix">
			<div class="goods_banner fl"><img src="{{ type.image.url }}"></div>
			<ul class="goods_list fl">
				{% for image_banners in type.image_banners %}
				<li>
					<h4><a href="/goods/detail/{{ image_banners.good.id }}/">{{ image_banners.good.name }}</a></h4>
					<a href="/goods/detail/{{ image_banners.good.id }}/"><img src="{{ image_banners.good.image.url }}"></a>
					<div class="prize">¥ {{ image_banners.good.price }}</div>
				</li>
				{% endfor %}
			</ul>
		</div>
	</div>
{% endfor %}
{% endblock content %}